package cn.com.maven.designpattern.prototype;

/**
 * @Author YongQiang
 * @Date 2021/5/18 13:29
 * @Version 1.0
 */
public class PrototypeTest {
    public static void main(String[] args) throws CloneNotSupportedException {
        PrototypeImpl1 prototypeImpl1=new PrototypeImpl1();
        prototypeImpl1.name="张三";
        System.out.println(prototypeImpl1);
        PrototypeImpl1 clone =(PrototypeImpl1) prototypeImpl1.clone();
        System.out.println(clone);
        clone.age=5;

        System.out.println(prototypeImpl1);
        System.out.println(clone);

    }
}
